package com.zhipu.balance.ui.home.system.personnel

import android.os.Bundle
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.zhipu.balance.R
import com.zhipu.balance.databinding.ActivityPersonnelBinding
import com.zhipu.balance.ui.BaseActivity
import com.zhipu.balance.ui.vm.home.system.personnel.PersonnelViewModel
import com.zhipu.balance.utils.InitializeUtils

/**
 * 人员管理
 */
class PersonnelActivity : BaseActivity<ActivityPersonnelBinding>(){



    //VM
    var personnelViewModel: PersonnelViewModel? = null

    override fun initCreate() {
        super.initCreate()
        InitializeUtils.AppComponent()?.doInjectionMain(this)
        personnelViewModel = ViewModelProvider(this, viewModelFactory)[PersonnelViewModel::class.java]
    }




    /**
     * 初始化根布局
     *
     * @return 布局layout的id
     */
    override fun initContentView(savedInstanceState: Bundle?): Int {
        return R.layout.activity_personnel
    }


    override fun initView() {
        super.initView()
        binding.viewModel = personnelViewModel
        binding.rv.layoutManager = object : LinearLayoutManager(mContext) {}
        binding.rv.adapter = personnelViewModel?.mPersonnelAdapter
    }

    override fun initData() {
        super.initData()

    }
}